<template>
	<view class="paysuccess">
		<view class="succpage">
			<view class="successr">
				<view class="tops">
					点击外部链接前往支付
				</view> 
				<!-- @click="gohome" -->
				<view class="bottoms">
					返回首页
				</view>
			</view>
		</view>

	</view>

</template>

<script>
	import $http from '@/common/api/request.js'
	export default {
		data() {
			return {

			};
		},
		methods: {
			//完成订单状态更正:
			subedistate(id) {
				$http.request({
					url: "/membereditordestate",
					method: "POST",
					data: {
						outTradeNo: id
					}
				}).then((res) => {

				}).catch(() => {
					console.log(id);
					uni.showToast({
						title: "订单状态更正失败",
						icon: "error",
						mask: true,
						duration: 2000
					})
				})
			},
			//返回首页:
			gohome() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			},
			//生成详细订单:
			generateDetailedOrder(e) {
				$http.request({
					url: "/membergenerateDetailedOrder",
					method: "POST",
					data: {
						alires: JSON.stringify(e)
					}
				}).then((res) => {
					
				}).catch(() => {
					uni.showToast({
						title: "生成详细订单失败.",
						icon: "error",
						mask: true,
						duration: 2000
					})
				})
			}
		},
		onLoad(e) {
			
			if (e) {
				this.generateDetailedOrder(e);
				this.subedistate(e.order_id);
				
			}
		},
		computed: {

		}
	}
</script>

<style lang="scss">
	.paysuccess {
		height: 90vh;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.succpage {
		.successr {

			.tops {
				text-align: center;
				color: #1a9c34;
				width: 100%;
			}

			.bottoms {
				border: 1rpx solid #06a1ff;
				padding: 10rpx 20rpx;
				border-radius: 40rpx;
				text-align: center;
			}
		}
	}
</style>